fix(load): add support for factory-callback parser presets #834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #830
Motivation and Context
Not all presets worked flawlessly with the existing load-preset code. The code had no support for presets that required a initialise-callback. I'm not sure if the "example atom preset" from here worked because of this. But this PR helps solving that issue.
We could also integrate the
conventional-changelog-loader
into@commitlint/load
, didn't have much luck with that but I could try implementing it again. I do have some doubt if it will remove some of the code already added in this PR, because we still have to initialise it.Usage examplesHow Has This Been Tested?
Instead of creating similar-structured presets, I added the actual preset modules in the tests. So far, I could find 3 different types of presets.
{ parserOpts: {} }
, like angular(null, { parserOpts: {} })
, like atomparserOpts
as function), like conventionalcommitsAll these changelogs are now feature-tested and included in the PR.
Types of changes
Checklist: